package com.ellwood.copyright.common.core.result.pojo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

/**
 * @ProjectName: ell-copyright-pro
 * @PackageName: com.ellwood.copyright.common.core.result.pojo
 * @ClassName: EllPage
 * @Description: // 查询公共参数以及分页基础信息
 * @Author: Ellwood
 * @CreateDate: 2024/11/11 - 17:58
 * @Version: V1.0.0
 */
@Data
public class EllQuery {

    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码不能小于1")
    @Schema(description = "当前页码", required = true)
    private Integer page;

    @NotNull(message = "每页条数不能为空")
    @Range(min = 1, max = 1000, message = "每页条数，取值范围 1-1000")
    @Schema(description = "每页条数", required = true)
    private Integer limit;

    @Schema(description = "是否降序排序")
    private String order;

    @Schema(description = "是否升序排序")
    private boolean asc;

}
